const { DataTypes } = require("sequelize");

const seq = require("../DB/seq");

const TextFile = seq.define(
  "mac_textfile",
  {
    filename: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: "文件的名字",
      defaultValue: "未命名文件",
    },
    filekind: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 1,
      comment: "文件种类",
    },
    iconUrl: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "txt.png",
      comment: "文件的icon图标",
    },
    fatherID: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 1,
      comment: "父亲文件的ID",
    },
    filesize: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: "文件的大小",
    },
    filecontent: {
      type: DataTypes.STRING,
      allowNull: true,
      defaultValue: "",
      comment: "文件的内容",
    },
  },
  {
    paranoid: true,
  }
);
module.exports = TextFile;
